package ui;

/**
 * JFrame ScreenWB
 * 
 * @author XA9
 * 
 */

import java.awt.CardLayout;
import java.awt.Font;

import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;
import javax.swing.plaf.FontUIResource;

public class ScreenWB extends JFrame {

	public static final String EMPLOYEELOGIN = "EMPLOYEELOGIN";
	public static final String ADDCUSTOMER = "ADDCUSTOMER";
	public static final String ADDACCOUNT = "ADDACCOUNT";
	public static final String DELETECUSTOMER = "DELETECUSTOMER";
	public static final String HANDLECUSTOMERS = "HANDLECUSTOMERS";
	public static final String HANDLEACCOUNTS = "HANDLEACCOUNTS";
	public static final String EMPLOYEEMAINMENU = "EMPLOYEEMAINMENU";

	private JPanel contentPane;
	private EmployeeLogin employeeLogin;
	private AddCustomer addCustomer;
	private AddAccount addAccount;
	private HandleCustomers handleCustomers;
	private HandleAccounts handleAccounts;
	private EmployeeMainMenu employeeMainMenu;

	private CardLayout c;

	/**
	 * Launch the application.
	 */
	// public static void main(String[] args) {
	// EventQueue.invokeLater(new Runnable() {
	// public void run() {
	// try {
	// Screen frame = new Screen();
	// frame.setVisible(true);
	// } catch (Exception e) {
	// e.printStackTrace();
	// }
	// }
	// });
	// }
	/**
	 * Create the frame.
	 */

	public ScreenWB() {
		super("ATMS Employee");
		setBackground(UIManager
				.getColor("TabbedPane.selectedTabTitlePressedColor"));
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 735, 650);
		contentPane = new JPanel();
		contentPane.setBackground(UIManager
				.getColor("TabbedPane.selectedTabTitlePressedColor"));
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new CardLayout(0, 0));

		employeeLogin = new EmployeeLogin();
		contentPane.add(employeeLogin, "EMPLOYEELOGIN");

		addCustomer = new AddCustomer();
		contentPane.add(addCustomer, "ADDCUSTOMER");

		addAccount = new AddAccount();
		contentPane.add(addAccount, "ADDACCOUNT");

		handleCustomers = new HandleCustomers();
		contentPane.add(handleCustomers, "HANDLECUSTOMERS");

		handleAccounts = new HandleAccounts();
		contentPane.add(handleAccounts, "HANDLEACCOUNTS");

		employeeMainMenu = new EmployeeMainMenu();
		contentPane.add(employeeMainMenu, "EMPLOYEEMAINMENU");

		c = (CardLayout) getContentPane().getLayout();

	}

	/**
	 * Show JOption MessageDialog
	 * 
	 */
	public void showMessage(String message) {
		UIManager.put("OptionPane.messageFont", new FontUIResource(new Font(
				"Eurostile", Font.PLAIN, 12)));
		JOptionPane.showMessageDialog(this, message);

	}

	/**
	 * Show JOption InputDialog
	 * 
	 * @return x
	 */
	public String getInput(String message) {
		String x;
		UIManager.put("OptionPane.messageFont", new FontUIResource(new Font(
				"Eurostile", Font.PLAIN, 12)));
		x = JOptionPane.showInputDialog(this, message);

		return x;
	}

	/**
	 * Returns contentPane
	 * 
	 * @return handleCustomers
	 */
	public HandleCustomers getHandleCustomers() {
		return handleCustomers;
	}

	/**
	 * Returns contentPane
	 * 
	 * @return handleAccounts
	 */
	public HandleAccounts getHandleAccounts() {
		return handleAccounts;
	}

	/**
	 * Returns contentPane
	 * 
	 * @return addCustomer
	 */
	public AddCustomer getAddCustomer() {
		return addCustomer;
	}

	/**
	 * Returns contentPane
	 * 
	 * @return addAccount
	 */
	public AddAccount getAddAccount() {
		return addAccount;
	}

	/**
	 * Returns contentPane
	 * 
	 * @return employeeLogin
	 */
	public EmployeeLogin getEmployeeLogin() {
		return employeeLogin;
	}

	/**
	 * Returns contentPane
	 * 
	 * @return employeeMainMenu
	 */
	public EmployeeMainMenu getEmployeeMainMenu() {
		return employeeMainMenu;
	}

	/**
	 * Show specified contentPane
	 * 
	 */
	public void Show(String card) {
		c.show(this.getContentPane(), card);
	}
}
